package leets.leet2350;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution {
    public int shortestSequence(int[] rolls, int k) {
        var mark = new int[k + 1]; // mark[v] 标记 v 属于哪个子段
        int ans = 1, left = k;
        for (var v : rolls)
            if (mark[v] < ans) {
                mark[v] = ans;
                if (--left == 0) {
                    left = k;
                    ++ans;
                }
            }
        return ans;
    }
}

